<template>
	<view>
		<u-navbar title="新增后候选人" rightText="保存" placeholder="true" @rightClick="rightClick" :autoBack="true">
		</u-navbar>
		<view>
			<view>

				<view>
					<view class="txt"><text class="red">*</text><text class="tet">申请职位</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.position"></u--input>
				</view>
				<view>
					<view class="txt"><text class="red">*</text><text class="tet">简历来源</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.source"></u--input>
				</view>
				<view>
					<view class="txt"><text class="red">*</text><text class="tet">候选人状态</text></view>
					<radio-group @change="radioChange1" class="shuru1">
						<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in status" :key="item.value">
							<radio :value="item.value" :checked="item.checked" /><span>{{item.label}}</span>
						</label>
					</radio-group>
				</view>
				<view>
					<view class="txt">
						<text class="tet">自我评价</text>
					</view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.evaluation"></u--input>
				</view>
			</view>
			<view class="jg">
				<h3 class="h">基本信息</h3>
				<view>
					<view class="txt"><text class="red">*</text><text class="tet">姓名</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.rname"></u--input>
				</view>
				<view>
					<view class="txt"><text class="red">*</text><text class="tet">手机号</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.rphone"></u--input>
				</view>
				<view>
					<view class="txt">
						<text class="tet">性别</text>
					</view>
					<radio-group @change="radioChange" class="shuru1">
						<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in sex" :key="item.value">
							<radio :value="item.value" :checked="item.checked" /><span>{{item.label}}</span>
						</label>
					</radio-group>
					<!-- <label class="shuru">
					<radio value="1" checked="checked" /><text>男</text>	
					<radio value="0" /><text>女</text>
					</label> -->
				</view>
				<view>
					<view class="txt">
						<text class="tet">出生日期</text>
					</view>
					<uni-datetime-picker class="shuru1" type="date" v-model="data.rbirthday" :clear-icon="false"
						@maskClick="maskClick" />
					<!-- <u--input type="date" class="shuru" placeholder="请输入" border="surround" v-model="rbirthday">
					</u--input> -->
				</view>
				<view>
					<view class="txt">
						<text class="tet">学历</text>
					</view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.education"></u--input>
				</view>
				<view>
					<view class="txt">
						<text class="tet">工作经验</text>
					</view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.workexp"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">民族</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.rnation"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">籍贯</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.nativeaddres"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">户籍地址</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.residence"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">婚姻状况</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.marriage"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">邮箱地址</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.remail"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">微信</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.rwechat"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">QQ</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.rqq"></u--input>
				</view>
			</view>
			<view class="jg">
				<h3 class="h">求职意向</h3>
				<view>
					<view class="txt"><text class="tet">期望行业</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.industry"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">期望职位</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.rposition"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">期望年薪</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.rsalary"></u--input>
				</view>
				<view>
					<view class="txt"><text class="tet">期望工作地</text></view>
					<u--input class="shuru" placeholder="请输入" border="surround" v-model="data.workaddress"></u--input>
				</view>
			</view>
		</view>
		<view class="danyuan">
			<u-cell-group>
				<u-cell size="large" title="工作经历" value="添加" @click="gongzuo()"></u-cell>
				<u-cell size="large" title="教育经历" value="添加" @click="jiaoyu()"></u-cell>
				<u-cell size="large" title="项目经历" value="添加" @click="xiangmu()"></u-cell>
				<u-cell size="large" title="技能" value="添加" @click="jineng()"></u-cell>
			</u-cell-group>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				status: [{
						label: "初筛",
						value: 1,
						checked: true
					}, {
						label: "面试",
						value: 2
					},
					{
						label: "录用",
						value: 3
					},
					{
						label: "入职",
						value: 4
					},
					{
						label: "淘汰",
						value: 5
					}
				],
				sex: [{
					label: "男",
					value: 1,
					checked: true
				}, {
					label: "女",
					value: 0
				}],
				data: {
					rid: "",
					position: "",
					source: "",
					status: "",
					evaluation: "",
					rname: "",
					rphone: "",
					sex: "",
					rbirthday: "",
					education: "",
					workexp: "",
					rnation: "",
					nativeaddres: "",
					residence: "",
					marriage: "",
					remail: "",
					rwechat: "",
					rqq: "",
					industry: "",
					rposition: "",
					rsalary: "",
					workaddress: ""
				},
				userId: "",
			}
		},
		onLoad() {
			this.find();

		},
		methods: {
			find() {
				this.$request({
					url: 'entry/jianli/find',
					data: {

					},
					method: 'post',
					success: (res) => {
						console.log(res.data)
						this.userId = res.data
						this.data.rid = this.userId + 1
						console.log(this.data.rid)
					}

				})
			},
			rightClick() {
				console.log(this.data),
					this.$request({
						url: 'entry/jianli/tian',
						data: this.data,
						method: 'post',
						success: (res) => {
							this.review(),
								this.value = ""
						}

					})
			},
			confirm(e) {
				console.log(e);
				this.data.birthday = e;
				this.show2 = false
			},
			open() {
				// console.log('open');
			},
			close() {
				this.show = false
				// console.log('close');
			},
			into() {
				this.$axios({
					url: 'entry/jianli/into',
					data: {
						work: this.data

					},
					method: 'post',
					success: (res) => {
						this.review(),
							this.value = ""
					}

				})

			},
			radioChange(e) {
				this.data.sex = this.radio = e.detail.value
			},
			radioChange1(e) {
				this.data.status = this.radio = e.detail.value
			},
			gongzuo() {
				uni.navigateTo({
					url: './../ruzhi/gonzuo' + '?jid=' + this.data.rid
				})
			},
			jiaoyu() {
				uni.navigateTo({
					url: './../ruzhi/jiaoyu' + '?jid=' + this.data.rid
				})
			},
			xiangmu() {
				uni.navigateTo({
					url: './../ruzhi/xiangmu' + '?jid=' + this.data.rid
				})
			},
			jineng() {
				uni.navigateTo({
					url: './../ruzhi/jineng' + '?jid=' + this.data.rid
				})
			}
		},
	}
</script>
<style>
	.red {
		color: red;
	}

	.shuru {
		margin-top: 30rpx;
		height: 20px;
		float: left;
		width: 65%;
	}

	.txt {
		margin-left: 30rpx;
		margin-top: 30rpx;
		float: left;
		width: 20%;
	}

	.jg {
		margin-top: 20rpx;
		width: 100%;
	}

	.danyuan {
		margin-top: 20rpx;
		float: left;
		width: 100%;
	}

	.tet {
		color: #74777a;
	}

	.h {
		margin-left: 30rpx;
		margin-top: 20rpx;
		float: left;
		width: 100%;
	}

	.shuru1 {
		margin-top: 30rpx;
		float: left;
		width: 60%;
	}
</style>
